-
Notifications
You must be signed in to change notification settings - Fork 138
Feature/301 create utility scripts to compute the next release build for cbs #310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/301 create utility scripts to compute the next release build for cbs #310
Conversation
monvora
commented
Apr 11, 2025
- Add shell script to compute the next release version: computeReleaseVersion.sh
- Add Jenkins pipeline definition template that perform deployment through Wazi Deploy
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Co-authored-by: Mathieu Dalbin <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
…utility-scripts-to-compute-the-next-release-build-for-CBS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export mainBranchSegment=`echo ${Branch} | awk -F "/" '{ print $1 }'` | ||
export secondBranchSegment=`echo ${Branch} | awk -F "/" '{ print $2 }'` | ||
export thirdBranchSegment=`echo ${Branch} | awk -F "/" '{ print $3 }'` | ||
echo $PGM": [INFO] Branch segments: ${mainBranchSegment}, ${secondBranchSegment}, ${thirdBranchSegment}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this print. It is a big confusing.
Maybe put it into a comment and add a comment that this is for debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @dennis-behm for a review. I made all the changes we discussed. Now the PR contains:
- computeReleaseVersion.sh script to compute the next release version.
- Updated readme.md which documented about computeReleaseVersion.sh
Please have another reveiw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monvora - can you please add a section to the README about this new script, please?
…nor update to the computeReleaseVersion.sh script based on Dennis's feedback
Done... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monvora Thanks for the documentation updates. I tested your script and this caused a set of new ideas. Can you please check my comments below?
echo $PGM": [INFO] Baseline reference: ${baselineRef}" | ||
|
||
computeNextReleaseVersion | ||
export releaseVersion="rel-"${newVersion} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if newVersion
was computed - basically if it is "set" like the other environment variables. If the variable is empty, set RC=8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done...
@@ -133,7 +133,8 @@ Artifact Name | Description | Script details | |||
---------- | -----| ----------------------------------------------------- | |||
[gitClone.sh](gitClone.sh) | Pipeline Shell Script to perform Git Clone to z/OS UNIX System Services | [script details](README.md#41---gitclonesh) | |||
[dbbBuild.sh](dbbBuild.sh) | Pipeline Shell Script to invoke the Dependency Based Build framework [zAppBuild](https://github.com/IBM/dbb-zappbuild) | [script details](#dbbbuildsh-for-zappbuild-frameworkh) | |||
[zBuilder.sh](zBuilder.sh) | Pipeline Shell script to invoke the zBuilder framework [zBuilder](https://www.ibm.com/docs/en/dbb/3.0?topic=building-zos-applications-zbuilder) | [script details](#zbuildersh-for-dbb-zbuilder) | |||
[zBuilder.sh](zBuilder.sh) | Pipeline Shell Script to invoke the zBuilder framework [zBuilder](https://www.ibm.com/docs/en/dbb/3.0?topic=building-zos-applications-zbuilder) | [script details](#zbuildersh-for-dbb-zbuilder) | |||
[computeReleaseVersion.sh](computeReleaseVersion.sh) | Pipeline Shell Script to compute the next release version based on the baseline version information stored in the [baselineReference.config](samples/baselineReference.config) file. | [script details](#computeReleaseVersionsh) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[computeReleaseVersion.sh](computeReleaseVersion.sh) | Pipeline Shell Script to compute the next release version based on the baseline version information stored in the [baselineReference.config](samples/baselineReference.config) file. | [script details](#computeReleaseVersionsh) | |
[computeReleaseVersion.sh](computeReleaseVersion.sh) | Pipeline Shell Script to compute the next release version based on the baseline version information stored in the application's [baselineReference.config](samples/baselineReference.config) file. | [script details](#computeReleaseVersionsh) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
getBaselineReference | ||
if [ $rc -eq 0 ]; then | ||
ERRMSG=$PGM": [INFO] Baseline reference: ${baselineRef}" | ||
eecho $ERRMSG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eecho $ERRMSG | |
echo $ERRMSG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done and tested
;; | ||
*) | ||
rc=8 | ||
ERRMSG=$PGM": [ERROR] Release type can only be Major, Minor or Patch. rc="$rc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ERRMSG=$PGM": [ERROR] Release type can only be Major, Minor or Patch. rc="$rc | |
ERRMSG=$PGM": [ERROR] No valid release type found. Valid release types are 'major', 'minor' or 'patch'. rc="$rc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monvora I have a few more comments. Please see below. Thank you.
echo $ERRMSG | ||
fi | ||
|
||
tmp2=$(echo $ReleaseType | tr '[:upper:]' '[:lower:]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this section could lead to a wrong behaviour. We should not set a default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ERRMSG=$PGM": [INFO] Compute the next release version complete. The next release version: ${releaseVersion}. rc="$rc | ||
echo $ERRMSG | ||
else | ||
ERRMSG=$PGM": [ERROR] Compute the next release version failed. Check Console for details. rc="$rc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ERRMSG=$PGM": [ERROR] Compute the next release version failed. Check Console for details. rc="$rc | |
ERRMSG=$PGM": [ERROR] Compute the next release version failed. Check console for details. rc="$rc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments
|
||
# internal veriables | ||
PGM=$(basename "$0") | ||
PGMVERS="1.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PGMVERS="1.10" | |
PGMVERS="1.00" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
echo " -r <releaseType> - Type of the release " | ||
echo " to calculate the version. " | ||
echo " Accepted values: " | ||
echo " - Major " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any checking of the case for this parm? The README says "major, minor, patch" but here it says it's "Major, Minor, Patch".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I've seen the translation below to all lowercase, but for consistency, it would be better to have the same values everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated value in the computeReleaseVersion.sh file to "major", "minor" and "patch".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this important script, @monvora .